import requests
from DrissionPage import Chromium

tab = Chromium().latest_tab

# tab.listen.start("/aweme/v1/web/aweme/post/",)
# tab.get(
#     "https://www.douyin.com/user/MS4wLjABAAAA1DNjQYHWvhmrAWBuY2fCQo0i8tgaY1wJSvIdK7FTF_0?from_tab_name=main&modal_id=7488251361256049960")
# res = tab.listen.wait()
# data = res.response.body
#
# count = 0
# headers = {
#     "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Safari/537.36",
#     "referer": "https://www.douyin.com/"
# }
#
# for item in data['aweme_list']:
#     aweme_id = item["aweme_id"]
#     print(aweme_id)

tab.listen.start("/aweme/v1/web/comment/list/")

tab.get(
    "https://www.douyin.com/user/MS4wLjABAAAA1DNjQYHWvhmrAWBuY2fCQo0i8tgaY1wJSvIdK7FTF_0?from_tab_name=main&modal_id=7488251361256049960")
res = tab.listen.wait()
data = res.response.body

count = 0
headers = {
    "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Safari/537.36",
    "referer": "https://www.douyin.com/"
}

for item in data['user_commented']:

    print(item)

